package ast;

import src.NFA;

public abstract class ASTNode {
	
		//The value of the first ASCII printable character 
		protected static final char PRINTABLE_CHAR_START_VAL = 32;
	
		//The value of the last ASCII printable character
		protected static final char PRINTABLE_CHAR_END_VAL = 126;
	
		protected ASTNode leftChild;
		
		protected ASTNode rightChild;
		
		protected String value = "";

		//default constructor
		public ASTNode() {
			this.leftChild = null;
			this.rightChild = null;
			this.value = "";
		}

		//constructs node with given children
		public ASTNode(ASTNode leftChild, ASTNode rightChild) {
			this.leftChild = leftChild;
			this.rightChild = rightChild;
			this.value = "";
		}

		
		public ASTNode getLeftChild() {
			return leftChild;
		}
		public void setLeftChild(ASTNode leftChild) {
			this.leftChild = leftChild;
		}
		
		
		public ASTNode getRightChild() {
			return rightChild;
		}
		public void setRightChild(ASTNode rightChild) {
			this.rightChild = rightChild;
		}

		
		public String getValue() {
			return value;
		}
		public void setValue(String value) {
			this.value = value;
		}

		//returns the NFA generated from the tree
		public abstract NFA generateNFA();
}
